<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
pageContext.setAttribute("basePath",basePath);
%>
<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta charset="UTF-8">
		<title>试题新增</title>

		<link rel="stylesheet" type="text/css" href="${basePath}resources/bootstrap/css/bootstrap-responsive.css">
		<link rel="stylesheet" type="text/css" href="${basePath}resources/bootstrap/css/bootstrap.css">
		<link rel="stylesheet" type="text/css" href="${basePath}resources/css/basic.css">
		<link rel="stylesheet" type="text/css" href="${basePath}resources/css/login.css">

		<script type="text/javascript" src="${basePath}resources/js/common/base.js"></script>
		<script type="text/javascript" src="${basePath}resources/js/common/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="${basePath}resources/bootstrap/js/bootstrap.js"></script>
		<script type="text/javascript" src="${basePath}resources/angular-1.3.0/angular.min.js"></script>
		<script type="text/javascript" src="${basePath}resources/js/common/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="${basePath}resources/js/question_add.js"></script>
	</head>
	<body ng-app="myApp" ng-controller="questionAddController">
		<div id="header">
			<%@ include file="common/header.jsp" %>
			<h1>试题新增</h1>
		</div>
		<div id="container">
			<form onsubmit="return false;" method="post" name="questionAddForm" >
				<div>
					<span>选择试题类型</span>
					<select ng-model="type" ng-options="obj as obj.dictionaryValue for obj in questionTypeList">
					</select>
				</div>
				<p ng-if="selectedQuestionTypeID==1">
					{{dictionaryValue}}的答案格式为：A或者B或者C或者D
				</p>
				<p ng-if="selectedQuestionTypeID==2">
					{{dictionaryValue}}的答案格式为：A#B#C
					<span style="color: red;">
						(多选题的几个答案之间以
						<strong>#</strong>分割)
					</span>
				</p>
				<p ng-if="selectedQuestionTypeID==3">
					{{dictionaryValue}}的答案格式为：T或者F
				</p>
				<p>
					<label class="label label-length" for="questionContent">题干</label>
					<textarea rows="3" cols="20" name="questionContent" ng-model="questionContent" placeholder="题目完整描述" required >
					</textarea>
				</p>
				<p ng-show="selectedQuestionTypeID!=3">
					<label class="label label-length" for="selectionA">选项A</label>
					<textarea rows="3" cols="20" name="selectionA" ng-model="selectionA" placeholder="选项A描述" required ></textarea>
				</p>
				<p ng-show="selectedQuestionTypeID!=3">
					<label class="label label-length" for="selectionB">选项B</label>
					<textarea rows="3" cols="20" name="selectionB" ng-model="selectionB" placeholder="选项B描述" required ></textarea>
				</p>
				<p ng-show="selectedQuestionTypeID!=3">
					<label class="label label-length" for="selectionC">选项C</label>
					<textarea rows="3" cols="20" name="selectionC" ng-model="selectionC" placeholder="选项C描述" required ></textarea>
				</p>
				<p ng-show="selectedQuestionTypeID!=3">
					<label class="label label-length" for="selectionD">选项D</label>
					<textarea rows="3" cols="20" name="selectionD" ng-model="selectionD" placeholder="选项D描述" required ></textarea>
				</p>
				<p ng-show="selectedQuestionTypeID==1">
					<label class="label label-length" for="answerOfSin">答案</label>
					<input type="radio" name="answerOfSin" ng-model="answerOfSin" value="A" />A
					<input type="radio" name="answerOfSin" ng-model="answerOfSin" value="B" />B
					<input type="radio" name="answerOfSin" ng-model="answerOfSin" value="C" />C
					<input type="radio" name="answerOfSin" ng-model="answerOfSin" value="D" />D
				</p>
				<p ng-show="selectedQuestionTypeID==2">
					<label class="label label-length" for="answerOfMulti">答案</label>
					<input type="checkbox" name="answerOfMulti" ng-model="answerOfMulti[0]" value="A">A
					<input type="checkbox" name="answerOfMulti" ng-model="answerOfMulti[1]" value="B">B
					<input type="checkbox" name="answerOfMulti" ng-model="answerOfMulti[2]" value="C">C
					<input type="checkbox" name="answerOfMulti" ng-model="answerOfMulti[3]" value="D">D
				</p>
				<p ng-show="selectedQuestionTypeID==3">
					<label class="label label-length" for="answerOfJudge">答案</label>
					<input type="radio" name="answerOfJudge" ng-model="answerOfJudge" value="T" />T
					<input type="radio" name="answerOfJudge" ng-model="answerOfJudge" value="F" />F
				</p>
				<p>
					<label class="label label-length" for="answerAnalysis">答案解析(可选)</label>
					<textarea rows="3" cols="20" name="answerAnalysis" ng-model="answerAnalysis" ></textarea>
				</p>
				<p>
					<input type="submit" class="btn btn-primary" name="questionAddBtn" id="questionAddBtn" value="确认新增" ng-click="questionAddFunc()" ng-disabled="1==2"/>
				</p>
			</form>
		</div>
		<div id="footer">
			<%@ include file="common/footer.jsp" %>
		</div>
	</body>
</html>